package gmusic.command;

import gmusic.bo.ArtistBean;
import gmusic.bo.PaysBean;
import gmusic.services.impl.GMusicServicesImpl;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

public class AfficherFormModifArtistGM implements Command {

	// private final static Logger log =
	// Logger.getLogger(AfficherFormModifArtistGM.class);

	public String execute(HttpServletRequest req) throws Exception {

		HttpSession session = req.getSession();
		int agmid = Integer.parseInt(req.getParameter("id"));
		ArtistBean artist = GMusicServicesImpl.getInstance()
				.getArtistSearchWithGmid(agmid);
		List<PaysBean> pays = GMusicServicesImpl.getInstance().getAllPays();

		session.setAttribute("artist", artist);
		session.setAttribute("pays", pays);

		return "/modifierArtisteGM.jsp";
	}
}
